<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ taglib uri="/struts-tags"  prefix="s"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
    
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<base href="<%=basePath%>">
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>-.-</title>
		<link href="./styles/global.css"  rel="stylesheet"  type="text/css" media="all" />
		<script type="text/javascript" charset="utf-8" src="../plugins/kindeditor/kindeditor.js"></script>
		<script type="text/javascript" charset="utf-8" src="../plugins/kindeditor/lang/zh_CN.js"></script>
		<script type="text/javascript" src="./scripts/jquery-1.6.4.js"></script>
		<script>
		        KindEditor.ready(function(K) {
		                window.editor = K.create('#editor_id');
		        });
		        $(document).ready(function(){
		        	$("#selectFileBtn").click(function(){
		        		$fileField = $('<input type="file" name="thumbs[]"/>');
		        		$fileField.hide();
		        		$("#attachList").append($fileField);
		        		$fileField.trigger("click");
		        		$fileField.change(function(){
		        		$path = $(this).val();
		        		$filename = $path.substring($path.lastIndexOf("\\")+1);
		        		$attachItem = $('<div class="attachItem"><div class="left">a.gif</div><div class="right"><a href="#" title="删除附件">删除</a></div></div>');
		        		$attachItem.find(".left").html($filename);
		        		$("#attachList").append($attachItem);		
		        		});
		        	});
		        	$("#attachList>.attachItem").find('a').live('click',function(obj,i){
		        		$(this).parents('.attachItem').prev('input').remove();
		        		$(this).parents('.attachItem').remove();
		        	});
		        });
		</script>
	</head>
	<body>
	<h3>添加商品</h3>
	<form action="FurnitureInfo_addFurnitureInfo.action" method="post"  enctype="multipart/form-data" namespace="/">
		<table width="70%"  border="1" cellpadding="5" cellspacing="0" bgcolor="#cccccc">
		
		<tr>
			<td align="right">家具名称</td>
			<td><input type="text" name="furnitureInfo.furnitureName"  placeholder="请输入家具名称"/></td>
		</tr>
		<tr>
			<td align="right">商品分类</td>
			<td>
			<select name="cId">
			</select>
			</td>
		</tr>
		<tr>
			<td align="right">家具编号</td>
			<td><input type="text" name="furnitureInfo.furnitureId"  placeholder="请输入家具编号"/></td>
		</tr>
		<tr>
			<td align="right">添加数量</td>
			<td><input type="text" name="furnitureInfo.amount"  placeholder="请输入添加家具数量"/></td>
		</tr>
		<tr>
			<td align="right">商品市场价</td>
			<td><input type="text" name="furnitureInfo.marketPrice"  placeholder="请输入商品市场价"/></td>
		</tr>
		<tr>
			<td align="right">商品销售价</td>
			<td><input type="text" name="furnitureInfo.salePrice"  placeholder="请输入商品销售价"/></td>
		</tr>
		<tr>
			<td align="right">商品描述</td>
			<td>
				<textarea name="furnitureInfo.description" id="editor_id" style="width:100%;height:150px;"></textarea>
			</td>
		</tr>
<!-- 		<tr>
			<td align="right">商品图像</td>
			<td>
				<a href="javascript:void(0)" id="selectFileBtn">添加附件</a>
				<div id="attachList" class="clear"></div>
			</td>
		</tr> -->
		<tr>
			<td colspan="2"><input type="submit"  value="发布商品"/></td>
		</tr>
	</table>
	</form>
	</body>
</html>